package huawei.bfs;

import treenode.TreeNode;

public class J226 {
    public static TreeNode invertTree(TreeNode root) {
        if(root==null){
            return null;
        }
        invertTree(root.left);
        invertTree(root.right);
        TreeNode tmp = root.left;
        root.left=root.right;
        root.right=tmp;
        return root;
    }
}
